package com.ldj.tim.common.pojo;


import com.baomidou.mybatisplus.annotation.TableName;
import com.ldj.tim.common.constant.Constants;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

/**
 * @author majinhui
 * @description
 * @create 2024/11/11 17:20
 **/
@Data
public class P2PInfo extends BasicMessage implements Serializable {
    private Long ownerUid;
    private Long otherUid;
    private Integer boxType;

    public P2PInfo buildReceiver(P2PInfo sender) {
        P2PInfo receiver = new P2PInfo();
        BeanUtils.copyProperties(sender, receiver);
        receiver.setOwnerUid(sender.getOtherUid());
        receiver.setOtherUid(sender.getOwnerUid());
        receiver.setBoxType(Constants.MsgBoxType.INBOX);
        return receiver;
    }

}
